package main

import "fmt"

type ATM struct {
	bank string
	area string
	amount int
}

type User struct {
	name string
	passwd string
	balance int
}

func (atm *ATM) store_money(user *User, money int) {
	atm.amount += money
	user.balance += money
	fmt.Printf("存款成功,%s账号余额为:%d\n",user.name,user.balance)
}

func (atm *ATM) get_money(user *User, money int) {
	atm.amount -= money
	user.balance -= money
	fmt.Printf("取款成功,%s账户余额为:%d\n",user.name,user.balance)
}

func main() {
	atm1 := ATM {
	bank: "农业银行",
	area: "东湖小区",
	amount: 500000,
}

user1 := User {
	name: "zhangsan",
	passwd: "123456",
	balance: 10000,
}

atm1.store_money(&user1,100)
atm1.get_money(&user1,100)
}